package top.kaoshanji.p1ch03b.config;

import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import top.kaoshanji.p1ch03b.service.TestService;

/**
 * 代码清单-p1ch03b-108页a：一个简单的自动配置类
 * @author kaoshanji
 * ^_^
 * create time 2025/5/19 19:14
 */
@AutoConfiguration
@ConditionalOnProperty(prefix = "javastack.starter", name = "enabled", havingValue = "true")
public class TestServiceAutoConfiguration {

    @Bean
    public TestService testService() {
        return new TestService();
    }

}
